<template>
  <div>

    <div class="VIPsecKill">

        <div class="block secKill_img">
          <el-image :src="src">
            <div slot="placeholder" class="image-slot">
              加载中<span class="dot">...</span>
            </div>
          </el-image>
        </div>

        <div class="secKill">
          <h3 secKill_time>秒杀倒计时：{{count}}</h3>
           <el-button round class="secKill_bt">圆角按钮</el-button>
        </div>
      </div>

  </div>
</template>

<script >
export default {
    data () {
        return {
            src: require("@/assets/img/会员秒杀.png"),
            count: '', //倒计时
            seconds: 864000
        }
    }
    ,
    mounted() {
        this.Time() //调用定时器
    },
    methods: {
        // 天 时 分 秒 格式化函数
        countDown() {
            let d = parseInt(this.seconds / (24 * 60 * 60))
            d = d < 10 ? "0" + d : d
            let h = parseInt(this.seconds / (60 * 60) % 24);
            h = h < 10 ? "0" + h : h
            let m = parseInt(this.seconds / 60 % 60);
            m = m < 10 ? "0" + m : m
            let s = parseInt(this.seconds % 60);
            s = s < 10 ? "0" + s : s
            this.count = d + '天' + h + '时' + m + '分' + s + '秒'
        },
        //定时器没过1秒参数减1
        Time() {
            setInterval(() => {
                this.seconds -= 1
                this.countDown()
            }, 1000)
        },
    }

}
</script>

<style scoped lang="less">
h3 {
  display: inline;
  color: rgb(243, 15, 15);
}
.block {
  width: 100%;
}
.secKill {

  margin-bottom: 30px;
  width: 100%;
}
.secKill_bt{
  
  margin-left: 40px;
  
} 

</style>